<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/svg+xml" href="/vite.svg" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="PersonaLink - 多人格AI助手，提供医疗咨询、美食推荐、情感陪伴等服务" />
    <meta name="keywords" content="AI助手,人格切换,医疗咨询,美食推荐,情感陪伴,多模态交互" />
    <meta name="author" content="PersonaLink Team" />
    <title>PersonaLink - 多人格AI助手</title>
    
    <!-- 预加载关键资源 -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    
    <!-- 字体 -->
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
    
    <!-- 基础样式 -->
    <style>
      * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      
      html, body {
        height: 100%;
        font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        overflow: hidden;
      }
      
      #app {
        height: 100vh;
        width: 100vw;
      }
      
      /* 加载动画 */
      .loading-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        transition: opacity 0.5s ease-out;
      }
      
      .loading-logo {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
        animation: pulse 2s ease-in-out infinite;
      }
      
      .loading-text {
        color: white;
        font-size: 18px;
        font-weight: 500;
        margin-bottom: 30px;
        opacity: 0.9;
      }
      
      .loading-spinner {
        width: 40px;
        height: 40px;
        border: 3px solid rgba(255, 255, 255, 0.3);
        border-top: 3px solid white;
        border-radius: 50%;
        animation: spin 1s linear infinite;
      }
      
      @keyframes pulse {
        0%, 100% { transform: scale(1); opacity: 1; }
        50% { transform: scale(1.1); opacity: 0.8; }
      }
      
      @keyframes spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(360deg); }
      }
      
      /* 隐藏加载动画 */
      .loading-container.hidden {
        opacity: 0;
        pointer-events: none;
      }
    </style>
  </head>
  <body>
    <div id="app">
      <!-- 加载动画 -->
      <div id="loading" class="loading-container">
        <div class="loading-logo">
          <svg viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
            <circle cx="50" cy="50" r="45" stroke="white" stroke-width="2" fill="none" opacity="0.3"/>
            <circle cx="50" cy="30" r="8" fill="white"/>
            <circle cx="30" cy="60" r="6" fill="white" opacity="0.8"/>
            <circle cx="70" cy="60" r="6" fill="white" opacity="0.8"/>
            <path d="M35 75 Q50 85 65 75" stroke="white" stroke-width="2" fill="none" stroke-linecap="round"/>
          </svg>
        </div>
        <div class="loading-text">PersonaLink 正在启动...</div>
        <div class="loading-spinner"></div>
      </div>
    </div>
    
    <script type="module" src="/src/main.ts"></script>
    
    <!-- 加载完成后隐藏动画 -->
    <script>
      window.addEventListener('load', () => {
        setTimeout(() => {
          const loading = document.getElementById('loading');
          if (loading) {
            loading.classList.add('hidden');
            setTimeout(() => {
              loading.remove();
            }, 500);
          }
        }, 1000);
      });
    </script>
  </body>
</html>